package com.engine4cloud.tdf.supervision.convert;

import com.engine4cloud.tdf.supervision.dto.create.JzdxJudgmentCreateDTO;
import com.engine4cloud.tdf.supervision.dto.result.DcpgInvestigationResultDTO;
import com.engine4cloud.tdf.supervision.dto.update.JzdxJudgmentUpdateDTO;
import com.engine4cloud.tdf.supervision.entity.JzdxJudgmentEntity;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

@Mapper
public interface JzdxJudgmentConvert {
    JzdxJudgmentConvert INSTANCE = Mappers.getMapper(JzdxJudgmentConvert.class);

    JzdxJudgmentEntity create(JzdxJudgmentCreateDTO s, Long tenantId);

    JzdxJudgmentCreateDTO createTo(DcpgInvestigationResultDTO s);

    JzdxJudgmentEntity update(JzdxJudgmentUpdateDTO s);

    default JzdxJudgmentCreateDTO create(DcpgInvestigationResultDTO s, String code) {
        JzdxJudgmentCreateDTO judgment = createTo(s);
        judgment.setRybh(code);
        return judgment;
    }
}

